package com.bzkj.basicinfo.service.ncc;

import com.bzkj.basicinfo.domain.basic.vo.StoUnitVo;
import com.bzkj.basicinfo.domain.ncc.StoUnit;
import com.bzkj.basicinfo.domain.wms.vo.*;
import com.bzkj.common.core.domain.AjaxResult;
import com.bzkj.common.core.domain.R;

import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;

/**
 * @author Admin
 * @description 货位服务接口，定义了货位的基本操作
 */
public interface StoUnitService
{
    /**
     * 新增货位
     *
     * @param stoUnit 新增的货位对象
     * @return 新增的货位记录数
     */
    AjaxResult addStoUnit(StoUnit stoUnit);

    /**
     * 更新货位
     *
     * @param stoUnit 更新的货位对象
     * @return 更新的货位记录数
     */
    int updateStoUnit(StoUnit stoUnit);

    /**
     * 根据ID查询货位
     *
     * @param stoUnitId 货位的唯一标识符
     * @return 查询到的货位对象
     */
    StoUnit getStoUnitById(String stoUnitId);

    /**
     * 根据库区ID查询货位
     *
     * @param stoAreaId 库区的唯一标识符
     * @return 查询到的货位列表
     */
    List<StoUnit> getStoUnitsByAreaId(String stoAreaId);

    /**
     * 查询所有货位
     *
     * @return 所有货位的列表
     */
    List<StoUnit> getAllStoUnits(StoUnit stoUnit);

    /**
     * 删除货位
     *
     * @param stoUnitId 货位的唯一标识符
     * @return 删除的货位记录数
     */
    int deleteStoUnit(String stoUnitId);

    // 检查货位是否被使用
    boolean isStoUnitInUse(String stoUnitId);

    List<StoUnitVo> queryStoUnit(String stoAreaId);

     List<HashMap<String, Object>> queryStoUnit(String sto_area_code, String sto_unit_code);

    List<HashMap<String, Object>> queryGoods(String name, String materialspec, String vbatchcode, String pkMaterial);

    R queryStoUnitInfo(String stoAreaCode, String stoUnitCode);

    /**
     * 获取所有的货位层数
     *
     * @return
     */
    R getAllStorageNumber(String stoId,String stoAreaId);

    /**
     * 新增货位(单独追加货位）
     *
     * @param stoUnit 新增的货位对象
     * @return 新增的货位记录数
     */
    AjaxResult addStoUnitStorage(StoUnit stoUnit);

    /**
     * 货位报表统计
     *
     * @param wareHouseID
     * @param wareHouseValue
     * @param wareHouseTypeID
     * @param wareHouseTypeIDValue
     * @param unitTypeId
     * @param unitTypeIdValue
     * @param sType
     * @return
     */
    R wmsReportUnitStatistic(String wareHouseID, String wareHouseValue,
                             String wareHouseTypeID, String wareHouseTypeIDValue,
                             String unitTypeId, String unitTypeIdValue,
                             String sType);

    /**
     *
     * @param skuID 商品id
     * @param skuclassId 商品分类id
     * @param wareHouseID 仓库id
     * @param openBatchNo 是否启用批次管理
     * @param batchNo 批次号
     * @param batchNoValue 批号模式：0等于任意一个 1等于 2不等于  3包含 4不包含
     * @param beginDate 开始时间
     * @param endDate 结束时间
     * @param turnoverRateMinVal 周转率最小值
     * @param turnoverRateMaxVal 周转率最大值
     * @param turnoverDay 周转天数
     * @param turnoverDayValue 0 大于等于 1 小于
     * @param skuRateMinVal 使用率区间开始
     * @param skuRateMaxVal 使用率区间结束
     * @return
     */
    R wmsReportBasicStatistic(String skuID, String skuclassId,
                              String wareHouseID, String openBatchNo,
                              String batchNo, String batchNoValue,
                              String beginDate, String endDate,
                              String turnoverRateMinVal, String turnoverRateMaxVal,
                              String turnoverDay, String turnoverDayValue,
                              String skuRateMinVal, String skuRateMaxVal,Integer pageNum,Integer pageSize);

    AjaxResult exportReportBasicStatistic(String skuID, String skuclassId,
                                          String wareHouseID, String openBatchNo,
                                          String batchNo, String batchNoValue,
                                          String beginDate, String endDate,
                                          String turnoverRateMinVal, String turnoverRateMaxVal,
                                          String turnoverDay, String turnoverDayValue,
                                          String skuRateMinVal, String skuRateMaxVal,Integer pageNum,Integer pageSize,
                                          HttpServletResponse response);

    AjaxResult exportPdfReportBasicStatistic(String skuID, String skuclassId,
                                             String wareHouseID, String openBatchNo,
                                             String batchNo, String batchNoValue,
                                             String beginDate, String endDate,
                                             String turnoverRateMinVal, String turnoverRateMaxVal,
                                             String turnoverDay, String turnoverDayValue,
                                             String skuRateMinVal, String skuRateMaxVal,
                                             Integer pageNum,Integer pageSize,
                                             HttpServletResponse response);

    List<ExportReportBasicVo> exportCsvReportBasicStatistic(String skuID, String skuclassId,
                                                            String wareHouseID, String openBatchNo,
                                                            String batchNo, String batchNoValue,
                                                            String beginDate, String endDate,
                                                            String turnoverRateMinVal, String turnoverRateMaxVal,
                                                            String turnoverDay, String turnoverDayValue,
                                                            String skuRateMinVal, String skuRateMaxVal,
                                                            Integer pageNum, Integer pageSize,
                                                            HttpServletResponse response);
    //------------------周转率、使用率导出接口-----------------
    AjaxResult exportReportTurnoverStatistic(String skuID, String skuclassId,
                                          String wareHouseID, String openBatchNo,
                                          String batchNo, String batchNoValue,
                                          String beginDate, String endDate,
                                          String turnoverRateMinVal, String turnoverRateMaxVal,
                                          String turnoverDay, String turnoverDayValue,
                                          String skuRateMinVal, String skuRateMaxVal,Integer pageNum,Integer pageSize,
                                          HttpServletResponse response);

    AjaxResult exportPdfReportTurnoverStatistic(String skuID, String skuclassId,
                                             String wareHouseID, String openBatchNo,
                                             String batchNo, String batchNoValue,
                                             String beginDate, String endDate,
                                             String turnoverRateMinVal, String turnoverRateMaxVal,
                                             String turnoverDay, String turnoverDayValue,
                                             String skuRateMinVal, String skuRateMaxVal,
                                             Integer pageNum,Integer pageSize,
                                             HttpServletResponse response);

    List<ExportReportTurnoverVo> exportCsvReportTurnoverStatistic(String skuID, String skuclassId,
                                                                  String wareHouseID, String openBatchNo,
                                                                  String batchNo, String batchNoValue,
                                                                  String beginDate, String endDate,
                                                                  String turnoverRateMinVal, String turnoverRateMaxVal,
                                                                  String turnoverDay, String turnoverDayValue,
                                                                  String skuRateMinVal, String skuRateMaxVal,
                                                                  Integer pageNum, Integer pageSize,
                                                                  HttpServletResponse response);

    /**
     * 周转率趋势统计
     *
     * @param skuID
     * @param skuclassId
     * @param wareHouseID
     * @param openBatchNo
     * @param batchNo
     * @param batchNoValue
     * @param beginDate
     * @param endDate
     * @param turnoverRateMinVal
     * @param turnoverRateMaxVal
     * @param turnoverDay
     * @param turnoverDayValue
     * @param skuRateMinVal
     * @param skuRateMaxVal
     * @return
     */
    R turnoverRate(String skuID, String skuclassId,
                   String wareHouseID, String openBatchNo,
                   String batchNo, String batchNoValue,
                   String beginDate, String endDate,
                   String turnoverRateMinVal, String turnoverRateMaxVal,
                   String turnoverDay, String turnoverDayValue,
                   String skuRateMinVal, String skuRateMaxVal);

    /**
     * 呆滞物料报表
     * @param skuID         商品id
     * @param skuClassID    商品分类id
     * @param wareHouseID   仓库id
     * @param batchNo       批号
     * @param batchNoValue  批号模式：0等于任意一个 1等于 2不等于 3 包含 4 不包含
     * @param sluggishBegin 呆滞开始天数
     * @param sluggishEnd   呆滞结束天数
     * @return
     */
    R wmsReportSluggishStatistic(String skuID, String skuClassID,
                                 String wareHouseID, String batchNo,
                                 String batchNoValue, String sluggishBegin,
                                 String sluggishEnd, Integer pageNum, Integer pageSize);

    AjaxResult exportReportSluggishStatistic(String skuID, String skuClassID,
                                    String wareHouseID, String batchNo,
                                    String batchNoValue, String sluggishBegin,
                                    String sluggishEnd,  Integer pageNum, Integer pageSize,HttpServletResponse response);

    /**
     * 不合格品统计报表
     * @param skuID 商品id
     * @param batchNo 批号
     * @param batchNoValue 批号模式：0等于任意一个 1等于 2不等于 3 包含 4 不包含
     * @return
     */
    R wmsReportUnqualifiedStatistic(String  skuClassId,String skuID, String batchNo, String batchNoValue,Integer pageNum,Integer pageSize);

    AjaxResult exportReportUnqualifiedStatistic(String skuClassId, String skuID, String batchNo, String batchNoValue,Integer pageNum,Integer pageSize, HttpServletResponse response);

    AjaxResult exportPdfReportUnqualifiedStatistic(String skuClassId, String skuID, String batchNo, String batchNoValue, Integer pageNum,Integer pageSize,HttpServletResponse response);

    List<ExportReportUnqualifiedVo> exportCsvReportUnqualifiedStatistic(String skuClassId, String skuID, String batchNo, String batchNoValue, Integer pageNum, Integer pageSize, HttpServletResponse response);

    /**
     * 产品发运记录报表
     * @param skuID 商品id
     * @param wareHouseID 仓库id
     * @param shippingMethod 运输方式
     * @param customerID 收货单位
     * @param vbillsCode 发货单号
     * @param batchNo 批号
     * @param batchNoValue
     * @param wareHouseOutBills 出库单号
     * @param beginDate 开始时间
     * @param endDate 结束时间
     * @return
     */
    R wmsReportDeliveryStatistic(String skuID, String wareHouseID, String shippingMethod,
                                 String customerID, String vbillsCode, String batchNo,
                                 String batchNoValue, String wareHouseOutBills,
                                 String beginDate, String endDate,Integer pageNum,Integer pageSize);

    AjaxResult exportReportDeliveryStatistic(String skuID, String wareHouseID, String shippingMethod,
                                             String customerID, String vbillsCode, String batchNo,
                                             String batchNoValue, String wareHouseOutBills,
                                             String beginDate, String endDate, Integer pageNum, Integer pageSize, HttpServletResponse response);

    AjaxResult exportPdfReportDeliveryStatistic(String skuID, String wareHouseID, String shippingMethod,
                                                String customerID, String vbillsCode, String batchNo,
                                                String batchNoValue, String wareHouseOutBills,
                                                String beginDate, String endDate, Integer pageNum, Integer pageSize, HttpServletResponse response);

    List<ExportReportDeliveryVo> exportCsvReportDeliveryStatistic(String skuID, String wareHouseID, String shippingMethod,
                                                                  String customerID, String vbillsCode, String batchNo,
                                                                  String batchNoValue, String wareHouseOutBills,
                                                                  String beginDate, String endDate, Integer pageNum, Integer pageSize, HttpServletResponse response);

    /**
     * 入厂总账报表接口
     * @param receivingDay
     * @param releaseDay
     * @param stateID
     * @param skuID
     * @param senderID
     * @param manufacturerID
     * @param batchNo
     * @param batchNoValue
     * @param pageNum
     * @param pageSize
     * @return
     */
    R wmsReportReceivingStatistic(String skuClassId,String receivingDay,String releaseDay,
                                  String stateID,String skuID,
                                  String senderID, String manufacturerID, String batchNo, String batchNoValue,
                                  Integer pageNum,Integer pageSize);

    AjaxResult exportReportReceivingStatistic(String skuClassId,String receivingDay,String releaseDay,
                                              String stateID,String skuID,
                                              String senderID, String manufacturerID, String batchNo, String batchNoValue, Integer pageNum,Integer pageSize,HttpServletResponse response);

    AjaxResult exportPdfReportReceivingStatistic(String skuClassId,String receivingDay,String releaseDay,
                                                 String stateID,String skuID,
                                                 String senderID, String manufacturerID, String batchNo, String batchNoValue
            , Integer pageNum,Integer pageSize,HttpServletResponse response);

    List<ExportReportReceivingVo> exportCsvReportReceivingStatistic(String skuClassId, String receivingDay, String releaseDay,
                                                                    String stateID, String skuID,
                                                                    String senderID, String manufacturerID, String batchNo, String batchNoValue, Integer pageNum,Integer pageSize,HttpServletResponse response);


    /**
     * 同比、环比数据接口
     * @param skuID
     * @param skuclassId
     * @param wareHouseID
     * @param openBatchNo
     * @param batchNo
     * @param batchNoValue
     * @param beginDate
     * @param endDate
     * @param turnoverRateMinVal
     * @param turnoverRateMaxVal
     * @param turnoverDay
     * @param turnoverDayValue
     * @param skuRateMinVal
     * @param skuRateMaxVal
     * @return
     */
    R wmsOnYearAndChainReport(String skuID, String skuclassId,
                              String wareHouseID, String openBatchNo,
                              String batchNo, String batchNoValue,
                              String beginDate, String endDate,
                              String turnoverRateMinVal, String turnoverRateMaxVal,
                              String turnoverDay, String turnoverDayValue,
                              String skuRateMinVal, String skuRateMaxVal,String beginDate1,String endDate1);

    /**
     * 库存盘点报表数据接口
     * @param inventoryID 盘点单号
     * @param warehouseId 仓库id
     * @param pageNum
     * @param pageSize
     * @return
     */
    R wmsInventoryCountReport(String inventoryID,String warehouseId,Integer pageNum,Integer pageSize);
}
